package com.shop.loan.proxy;

import com.shop.loan.oss.UCloudUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.fun.AttachmentProxy;

import javax.annotation.Resource;
import java.io.InputStream;

@Service
public class UCloudOosProxy implements AttachmentProxy {

    @Resource
    UCloudUtil uCloudUtil;

    @Value("${api.ucloud.oss.fileDomain}")
    private String fileDomain;

    @Override
    public String upLoad(InputStream inputStream, String path) {
        return uCloudUtil.putStream(inputStream, path);
    }

    @Override
    public String fileDomain() {
        return fileDomain;
    }


}
